<?php
class Ftp
{
    public function get($path)
    {
        $path = base64_decode($path);
        $connection = ssh2_connect('42.159.235.94', 10008);
        ssh2_auth_password($connection, 'unilever_sftp', 'K7iRlPZEtR');
        $sftp = ssh2_sftp($connection);
        $file = fopen("ssh2.sftp://$sftp/$path", 'r');
        while ($value = fgetcsv($file)) {
            $list[] = $value;
        }
        exit(base64_encode(serialize($list)));
    }
}
